<?php
//$cat or err('分类参数不正确！'); //便于显示所有商家
$catcode = $cat;

$catval = $CAT[$catcode];


$r = $db->get_one("SELECT COUNT(id) as count FROM ".DB_PRE."shop WHERE catcode LIKE '$catcode%' AND `areacode` LIKE '$acode%' AND status = 1");
$num = $r['count'];

$pagesize = 20; 
$page = isset($page) && !empty($page) ? intval($page) : 1;
$offset = ($page-1)*$pagesize;

$pages = m_pages($num, $page, 'index.php?file='.$file.'&amp;cat='.$catcode.$cityparam.'&amp;page=', $pagesize);
$r = $db->select("SELECT * FROM ".DB_PRE."shop WHERE catcode LIKE '$catcode%' AND `areacode` LIKE '$acode%' AND status = 1 ORDER BY id DESC LIMIT $offset,$pagesize");
array2utf8($r);

include mtpl('shoplist');
?>